<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>公告</title>
    <link rel="stylesheet" href="../../static/layui/css/layui.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
    <script type="text/javascript"
            src="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../../static/markdown/marked.min.js"></script>
    <style>
        body {
            background-color: #f1f1f1;
        }

        .alert {
            position: relative;
            padding: .75rem 1.25rem;
            margin-bottom: 1rem;
            border: 1px solid transparent;
            border-radius: .25rem
        }

        .close {
            position: absolute;
            top: 0;
            right: 0;
            padding: .75rem 1.25rem;
            color: inherit
        }

        .alert-warning {
            color: #856404;
            background-color: #fff3cd;
            border-color: #ffeeba
        }

        .close {
            float: right;
            font-size: 1.5rem;
            font-weight: 700;
            line-height: 1;
            color: #000;
            text-shadow: 0 1px 0 #fff;
            opacity: .5
        }

        .close:focus, .close:hover {
            color: #000;
            text-decoration: none;
            opacity: .75
        }

        .close:not(:disabled):not(.disabled) {
            cursor: pointer
        }

        button.close {
            padding: 0;
            background-color: transparent;
            border: 0;
            -webkit-appearance: none
        }

        .close {
            padding: 1rem;
            margin: -1rem -1rem -1rem auto
        }

        .alert-dismissible .close {
            position: absolute;
            top: 0;
            right: 0;
            padding: .75rem 1.25rem;
            color: inherit
        }

        .height-light {
            span {
                background-color: #009688;
            }
        }

        .layui-layout-admin .layui-logo {
            font-size: 24px;
            transition: all 0.5s;
        }

        .layui-layout-admin .layui-logo:hover {
            font-size: 40px;

            img {
                width: 30px;
            }
        }

        .layui-layout-admin .layui-logo img {
            width: 15px;
            margin-left: 5px;
            margin-top: 10px;
            transition: all 0.5s;
        }

        .layui-layout-admin .layui-body {
            top: 120px;
            right: 200px;
        }

        .layui-layout-admin .layui-footer {
            left: 0;
            right: 0;
            text-align: center;
        }

        .tab-bar {
            margin: 0 auto;
            width: calc(100% - 520px);
            height: 40px;
            background-color: rgb(35, 38, 46);
            display: flex;
            justify-content: space-around;
            border-radius: 0 0 40px 40px;
        }

        .tab-bar .tab-bar-item {
            a {
                color: #ffffff;
                display: block;
            }

            span {
                height: 5px;
                display: block;
            }

            align-self: center;
            height: 40px;
        }

        .tab-bar .tab-bar-item:hover {
            span {
                background-color: #009688;
            }
        }

        #li_4:hover {
            .tab-bar-item-item-parent {
                display: block;
            }

            .tab-bar-item-item {
                display: block;
            }
        }

        .tab-bar-item-item-parent {
            display: none;
            background-color: rgb(35, 38, 46);
            position: absolute;
            top: 60px;
            padding: 0 10px 5px 10px;
            border-radius: 5px;
        }

        .tab-bar-item-item-parent:hover {
            display: block;

            .tab-bar-item-item {
                display: block;
            }
        }

        .tab-bar-item-item {
            display: none;
            margin-top: 5px;
        }

        .tab-bar-item-item:hover {
            display: block;

            a {
                color: #25bba4;
            }
        }


        .container {
            position: fixed;
            bottom: 10px;
            left: 10px;
            height: 10px;
            width: calc(100% - 520px);
            margin: 0 auto;
            padding: 30px;
            background-color: #FFFFFF;
            border-radius: 5px;
            overflow-y: scroll;
        }

        .container > * {
            margin-bottom: 10px; /* 设置元素之间的外边距 */
            font-size: 16px;
        }

        .title {
            font-size: 40px;
            color: #1ba595;
        }

        .announcements {
            padding: 20px;
        }

        .announcements li {
            margin: 0;
            padding: 10px 0 10px 10px;
            background-color: #f1f1f1;
        }

        .announcements li:hover {
            background-color: #e1e1e1;
        }

        .announcements li p {
            display: inline-block;
            width: 40px;
            color: #00C0F7;
            font-size: 20px;
        }

        .announcements li a {
            display: inline-block;
            margin-left: 20px;
            text-decoration: underline;
            cursor: pointer;
        }
        /* 自定义滚动条的整体样式 */
        ::-webkit-scrollbar {
            width: 6px; /* 设置滚动条的宽度 */
        }

        /* 自定义滚动轨迹的样式 */
        ::-webkit-scrollbar-track {
            background: #f1f1f1; /* 设置滚动轨迹的背景颜色 */
        }

        /* 自定义滚动滑块的样式 */
        ::-webkit-scrollbar-thumb {
            background: #888; /* 设置滚动滑块的背景颜色 */
            border-radius: 3px; /* 滚动条圆角 */
        }

        /* 当鼠标悬停在滚动滑块上时的样式 */
        ::-webkit-scrollbar-thumb:hover {
            background: #555; /* 设置鼠标悬停时滚动滑块的背景颜色 */
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <a href="{{ url_for('index_student') }}">
            <div class="layui-logo">图书<img src="../static/logo.png"></div>
        </a>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="../../static/avatar/{{avatar}}.png" class="layui-nav-img">
                    {{ name }}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="{{ url_for('user_info_student', id=current_user.card_id) }}">个人信息</a></dd>
                    <dd><a href="{{ url_for('change_password_student') }}">修改密码</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="{{ url_for('logout') }}">退出登录</a></li>
        </ul>
    </div>
    <div class="tab-bar">
        <div id="li_1" class="tab-bar-item">
            <a href="{{url_for('index_student')}}">首页</a>
            <span></span>
        </div>
        <div id="li_2" class="tab-bar-item">
            <a href="{{ url_for('recommend') }}">智能推荐</a>
            <span></span>
        </div>
        <div id="li_3" class="tab-bar-item">
            <a href="{{ url_for('search_book_student') }}">图书查询</a>
            <span></span>
        </div>
        <div id="li_4" class="tab-bar-item">
            <a href="javascript:;">图书管理▼</a>
            <div class="tab-bar-item-item-parent">
                <div class="tab-bar-item-item" id="li_4_1"><a href="{{ url_for('borrow_student') }}">图书借阅</a>
                </div>
                <div class="tab-bar-item-item" id="li_4_2"><a href="{{ url_for('return_book_student') }}">图书归还</a>
                </div>
            </div>
            <span></span>
        </div>
        <div id="li_5" class="tab-bar-item">
            <a href="{{ url_for('change_info_student') }}">信息设置</a>
            <span></span>
        </div>
        <div id="li_6" class="tab-bar-item">
            <a href="{{ url_for('announcement_student') }}">查看公告</a>
            <span></span>
        </div>
        <div id="li_7" class="tab-bar-item">
            <a href="{{ url_for('comments_student') }}">读者留言</a>
            <span></span>
        </div>
    </div>

    <div class="container" id="container">
        <h1 class="title">公告</h1>
        <hr/>
        <ul class="announcements" id="announcements">
            {% for announcement in announcements %}
            <li>
                <p>{{ loop.index }}</p>
                <a href="/announcement/{{announcement.id}}">{{ announcement.name }}</a>
            </li>
            {% endfor %}
        </ul>
    </div>

    <div class="layui-footer">
        Copyright 2024 Construct
    </div>

    <canvas id="side-canvas"></canvas>

    <!--<div id="left-cover"></div>
    <div id="right-cover"></div>-->
</div>
<script type="text/javascript" src="../../static/layui/layui.js"></script>
<script src="../static/js/particle-animation.js"></script>
<script>
    layui.use('element', function () {
        var element = layui.element;
        element.init();
    });
    $(document).ready(function () {
        $("#li_6").addClass("height-light");
        $("#container").css({
            'left': '260px',
            'bottom': '50px',
            'height': ($(window).height() - 220).toString() + "px",
        });
    });
</script>
</body>
</html>
